package com.cancan.cloud.shop.threadContext;

import java.util.HashMap;
import java.util.Map;

public class ThreadContext {

	/**
	 * 线程变量集合
	 */
	private Map<String,Object> variables = new HashMap<String,Object>();
	
	public ThreadContext() {
		
	}
	
	public Map<String,Object> getVariables(){
		return variables;
	}

	public void putAllVariables(Map<String,Object> map) {
		this.variables.putAll(map);
	}
	
	/**
	 * 取得线程变量值
	 * @param key
	 * @return
	 */
	public Object getVariable(String key) {
		return this.variables.get(key);
	}
	
	/**
	 * 设置线程变量值
	 * @param key
	 * @param value
	 */
	public void setVaiable(String key,Object value) {
		this.variables.put(key, value);
	}
}